<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/common/jsp/taglibs-nojs-nocss.jsp"%>
<%@ page isELIgnored="false" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<div id="pop_up_content">
	<div class="pop_up_title images_13">
		<s:if test="null==form.id || ''.equal(form.id)">
			新建客户家属信息
		</s:if>
		<s:else>
			编辑客户家属信息
		</s:else>
	</div>
	<div class="pop_up_body" style="overflow-y:scroll;height: 400px">
		<form id="saleChanceEdit" action="customerFamilyAction!editCustomerFamily.action" >
			<input type="hidden" value="<s:property value='customerId'/>" name="customerId"/>
			<input type="hidden" value="<s:property value='form.id'/>" name="form.id"/>
			<!-- 登记日期 -->
			<input type="hidden" value="<s:property value='form.createDate'/>" name="form.createDate"/>
			<!-- 登记人 -->
			<input type="hidden" value="<s:property value='form.writeMan'/>" name="form.writeMan"/>
			<table border="0" cellpadding="0" cellspacing="0" width="400px">
				
				<tr style="height:22px;">
					<td class="form_input_value" >
						名称
					</td>
					<td colspan="3">
						<s:if test="form==null||form.name==null">
							<input style="width:260" id="form.name" name="form.name" type="text" value="${form.name}" />	
						</s:if>
						<s:else>
							<input readonly="readonly" style="width:260" id="form.name" name="form.name" type="text" value="${form.name}"/>
						</s:else>
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td class="form_input_value" >
						<span class="red"></span>职位
					</td>
					<td colspan="3">
						<s:if test="form==null||form.job==null">
							<input style="width:260" id="form.job" name="form.job" type="text" value="${form.job}" />
						</s:if>
					    <s:else>
					    	<input readonly="readonly" style="width:260" id="form.job" name="form.job" type="text" value="${form.job}" />
					    </s:else>
					</td>
				</tr>
				<tr style="height:22px;">
					<td class="form_input_value" >
						<span class="red"></span>公司名称
					</td>
					<td colspan="3">
						<s:if test="form==null||form.companyName==null">
							<input style="width:260" id="form.companyName" name="form.companyName" type="text" value="${form.companyName}" />
						</s:if>
						<s:else>
							<input readonly="readonly" style="width:260" id="form.companyName" name="form.companyName" type="text" value="${form.companyName}" />
						</s:else>
					   
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td class="form_input_value" >
						<span class="red"></span>与客户关系
					</td>
					<td colspan="3">
						<s:if test="form==null||form.relation==null">
							<input style="width:260" id="form.relation" name="form.relation" type="text" value="${form.relation}" />
						</s:if>
					    <s:else>
					    	<input readonly="readonly" style="width:260" id="form.relation" name="form.relation" type="text" value="${form.relation}" />
					    </s:else>
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td class="form_input_value">
							<span class="red"></span>年龄
					</td>
					<td  colspan="3">
						<s:if test="form==null||form.age==null">
							<input style="width:260" id="form.age" name="form.age" type="text" value="${form.age}" />	
						</s:if>
						<s:else>
							<input readonly="readonly" style="width:260" id="form.age" name="form.age" type="text" value="${form.age}" />
						</s:else>
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td class="form_input_value">
							<span class="red"></span>性别
					</td>
					<td  colspan="3">
						<select id="form.sex" name="form.sex">
							<s:if test="form==null||form.sex==null">
								<s:if test="form.sex='女'">
									<option value="男">男</option>
									<option value="女" selected="selected">女</option>
								</s:if>
								<s:else>
									<option value="男" selected="selected">男</option>
									<option value="女">女</option>
								</s:else>
							</s:if>
							<s:else>
								<option value="<s:property value='form.sex'/>" ><s:property value="form.sex"/></option>
							</s:else>
						</select>
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td class="form_input_value" >
						<span class="red"></span>座机
					</td>
					<td colspan="3">
						<s:if test="form==null||form.telePhone==null">
							<input style="width:260" id="form.telePhone" name="form.telePhone" type="text" value="${form.telePhone}" />
						</s:if>
						<s:else>
							<input readonly="readonly" style="width:260" id="form.telePhone" name="form.telePhone" type="text" value="${form.telePhone}" />
						</s:else>
					   
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td class="form_input_value" >
						<span class="red"></span>手机
					</td>
					<td colspan="3">
						<s:if test="form==null||form.phone==null">
							<input style="width:260" id="form.phone" name="form.phone" type="text" value="${form.phone}" />
						</s:if>
					    <s:else>
					    	<input readonly="readonly" style="width:260" id="form.phone" name="form.phone" type="text" value="${form.phone}" />
					    </s:else>
					</td>
				</tr>
				
				<s:iterator value="cpList" status="stat">
					<tr>
						<td class="form_input_value"><s:property value="name"/></td>
						<td>
							<input type="hidden" name="cfiList[<s:property value="#stat.index"/>].customerPropId" value="<s:property value="id"/>" >
							<input type="hidden" name="cfiList[<s:property value="#stat.index"/>].id" value="<s:property value="cfiidMap.get(id)"/>" >
							<s:if test="cfiMap.get(id)!=null&&cfiMap.get(id)!=''">
								<input readonly="readonly" style="width:260" name="cfiList[<s:property value="#stat.index"/>].content" value="<s:property value="cfiMap.get(id)"/>" >
							</s:if>
							<s:else>
								<input  style="width:260" name="cfiList[<s:property value="#stat.index"/>].content" value="<s:property value="cfiMap.get(id)"/>" >
							</s:else>
						</td>
					</tr>
				</s:iterator>
				<tr style="height:22px;">
					<td></td>
					<td colspan="3">
						<input id="saleChanceEditSubmit" type="button" value="确定" class="btn" onmouseout="this.className='btn'" onmousedown="this.className='btn1'" onmouseover="this.className='btn2'">
						<input type="button" value="取消" class="btn" onclick="hideDialog()" onmouseout="this.className='btn'" onmousedown="this.className='btn1'" onmouseover="this.className='btn2'">
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>
<script>
	
	/* 表单提交 */
	i.formSubmit("saleChanceEditSubmit",	//绑定的按钮id
					  "saleChanceEdit" ,   //提交的表单id
					  function(result){
						  	var jsonMsgObj=new JsonMsgObj(result);
							var  msg=jsonMsgObj.getMessage();
						    var codeId=jsonMsgObj.getCodeid();
							var isOk=jsonMsgObj.getIsok();
							if( isOk ){
							    aerouiAlert(msg);
								hideDialog();// 隐藏窗口
								window.location.reload();
							}else{		// 如果编辑失败了
							  JsManageInfoHandleException( result , function(msg , codeId , isOk){
							  		hideDialog();// 隐藏窗口
							   });
						   }
						});
</script>